package com.lonwin.mes2u8.domain.u8;

import com.lonwin.mes2u8.common.CommonValue;
import com.lonwin.mes2u8.domain.mes.MesProductionQueryResult;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author DELL
 * @Date 2024-01-02 18:04
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class U8ProductionAddParamInfo {
    // 单据编号
    private String code;
    // 制单日期
    private Date date;
    // 制单人名称
    private String maker;
    // 仓库编码
    private String warehousecode;
    // 备注
    private String memory;
    // 收发类型编码
    private String receivecode;
    // 部门编码
    private String departmentcode;
    // 单据头自定义项1
    private String define1;
    // 单据头自定义项2
    private String define2;
    // 单据头自定义项3
    private String define3;
    // 单据头自定义项4
    private Date define4;
    // 单据头自定义项5
    private Integer define5;
    // 单据头自定义项6
    private Date define6;
    // 单据头自定义项7
    private BigDecimal define7;
    // 单据头自定义项8
    private String define8;
    // 单据头自定义项9
    private String define9;
    // 单据头自定义项10
    private String define10;
    // 单据头自定义项11
    private String define11;
    // 单据头自定义项12
    private String define12;
    // 单据头自定义项13
    private String define13;
    // 单据头自定义项14
    private String define14;
    // 单据头自定义项15
    private Integer define15;
    // 单据头自定义项16
    private BigDecimal define16;

    private List<U8ProductionAddParamInfoEntry> entry;

    public static U8ProductionAddParamInfo buildSelfByMesProductionQueryResult(MesProductionQueryResult mesProductionQueryResult) {
        return U8ProductionAddParamInfo.builder()
                .code(mesProductionQueryResult.getSno())
                .maker(CommonValue.U8_PRODUCTION_MAKER)
                .warehousecode(CommonValue.U8_PRODUCTION_WARE_HOUSE).receivecode("105").departmentcode("03")
                .build();
    }
}
